#include <stdio.h>
#include <fcntl.h>
#include <unistd.h>

int main(void)
{
    char buf[1024] = {0};

    int fd = open("/dev/leds", O_RDWR);
    if (fd < 0)
    {
        perror("open failed");
        return -1;
    }

    printf("open /dev/leds is successed!, using the device...\n");

    write(fd, "aaa", 4);
    read(fd, buf, 1024);

    printf("close the /dev/leds\n");
    close(fd);

    return 0;
}